import request from '@/utils/request'

/**
 * 任务列表
 * @param {*} status 
 */
export function getTasks(status) {
    return request({
        url: '/app/selectUserTasks?' + 'rStatus' + '=' + status,
        method: 'get'
    })
}

/**
 * 任务列表
 * @param {*}  query
 */
export function getUserAllTasks(query) {
    return request({
        url: '/app/selectUserAllTasks',
        method: 'get',
        params: query,
    })
}

/**
 * 获取未完成任务列表
 * @param {*} query 
 * @returns 
 */
export function selectUnCompleteTasks() {
    return request({
        url: '/app/selectUnCompleteTasks',
        method: 'get',
    })
}

/**
 * 任务提交
 * @param {actionGroupId,feedbackContent,attachId,status} data 
 */
export function getSubmit(data) {
    return request({
        url: '/drill/submitTask',
        method: 'post',
        data: data
    })
}

/**
 * 应急任务提交详情
 * @param {*} taskId 
 */
export function getDetail(taskId) {
    return request({
        url: '/drill/submitTask/selectUserAndGroup/' + taskId,
        method: 'get',
    })
}

/**
 * 附件查询
 * @param {attachIds} attachIds 
 * @returns 
 */
export function AttachIds(attachIds) {
    return request({
        url: '/com/ComAttach/selectManyAttach',
        method: 'post',
        data: attachIds
    })
}

/**
 * 预案任务提交
 * @param {*} data 
 * @returns 
 */
export function planSubmit(data) {
    return request({
        url: '/pla/task/submitTask',
        method: 'post',
        data: data
    })
}

/**
 * 预案任务详情
 * @param {*} 
 * @returns 
 */
export function TaskDetails(flag, type, userId) {
    return request({
        url: '/app/queryTasks?' + 'flag=' + flag + '&' + 'type=' + type + '&' + 'id=' + userId,
        method: 'get',
    })
}
